using System.Collections.Generic;
using System.Linq;

namespace Lync.Widget.Library.InstantMessaging
{	
	public class MessageQueue
	{
		public string Session { get; set; }
		private List<Message> _messages = new List<Message>();

		public MessageQueue(string session)
		{
			this.Session = session;
		}

		public List<Message> GetAllAndDelete()
		{
			List<Message> toReturn = _messages.ToList(); 
			_messages.Clear();
			return toReturn;

		}

		public void Add(Message message)
		{
			_messages.Add(message);
		}

		public int GetMessageCount()
		{
			return _messages.Count;
		}
	}
}